package com.gobi.controller;


import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * ctrl + f9
 */
@RestController
@Api
public class HelloWorldController {

    @Autowired
    private Environment environment;

    @GetMapping("/test2")
    public Object test(HttpServletRequest request) {
        String content = request.getRequestURL().toString();
        String port = environment.getProperty("server.port");
        content += port;
        return content;
    }
}
